package cn.cheln.support.images;

import android.graphics.Bitmap;
import android.net.Uri;
import cn.cheln.explorer.beans.FileInfo;
import cn.cheln.explorer.beans.FileUtil;
import cn.cheln.explorer.ds.MediaArgs;
import java.io.File;

public class FileTypeInfo
{
  public static final String apkMime = "application/vnd.shortcut.package-archive";
  public static FileTypeInfo[] typeInfos;
  public String category = "";
  public Bitmap defaultBg;
  public String ext;
  public FileCategoryHelper.FileCategory fc;
  public String mime;
  public String[] mimes;
  public Uri uri;

  static
  {
    FileTypeInfo[] arrayOfFileTypeInfo = new FileTypeInfo[4];
    arrayOfFileTypeInfo[0] = new FileTypeInfo(FileCategoryHelper.FileCategory.Music, FileInfo.iconAudio, new String[] { "audio" });
    arrayOfFileTypeInfo[1] = new FileTypeInfo(FileCategoryHelper.FileCategory.Video, FileInfo.iconVideo, new String[] { "video" });
    arrayOfFileTypeInfo[2] = new FileTypeInfo(FileCategoryHelper.FileCategory.Picture, FileInfo.iconImageLoading, new String[] { "image" });
    arrayOfFileTypeInfo[3] = new FileTypeInfo(FileCategoryHelper.FileCategory.Doc, FileInfo.iconDoc, new String[] { "application", "text" });
    typeInfos = arrayOfFileTypeInfo;
  }

  public FileTypeInfo(FileCategoryHelper.FileCategory paramFileCategory, Bitmap paramBitmap, String[] paramArrayOfString)
  {
    this.fc = paramFileCategory;
    this.mimes = paramArrayOfString;
    this.defaultBg = paramBitmap;
  }

  public FileTypeInfo(String paramString)
  {
    this.ext = paramString;
  }

  public static FileTypeInfo getTypeInfo(FileInfo paramFileInfo)
  {
    Uri localUri;
    String str1 = "";
    if (paramFileInfo.getName() == null)
      paramFileInfo.buildName();
    String str2 = FileUtil.getRealExtension(paramFileInfo.getName());
    FileTypeInfo localFileTypeInfo = new FileTypeInfo(str2);
    String str3 = MimeTypeMap.getSingleton().getMimeTypeFromExtension(str2.toLowerCase());
    if (str3 == null)
      return localFileTypeInfo;
    if (str3.startsWith("image"))
    {
      localUri = MediaArgs.ImageUri;
      str1 = "image";
    }
    while (true)
    {
      localFileTypeInfo.mime = str3;
      localFileTypeInfo.category = str1;
      localFileTypeInfo.uri = localUri;
      return localFileTypeInfo;
      if (str3.startsWith("audio"))
      {
        localUri = MediaArgs.AudioUri;
        str1 = "audio";
      }
      if (str3.startsWith("video"))
      {
        localUri = MediaArgs.VideoUri;
        str1 = "video";
      }
      if (paramFileInfo.getName().trim().toLowerCase().endsWith("apk"))
      {
        str1 = "apk";
        localUri = MediaArgs.otherUri;
      }
      if ((str3.startsWith("application")) || (str3.startsWith("text")))
      {
        str1 = "doc";
        localUri = MediaArgs.otherUri;
      }
      if (paramFileInfo.getFile().isDirectory())
      {
        str1 = "";
        localUri = MediaArgs.dirUri;
      }
      boolean bool = paramFileInfo.name.trim().toLowerCase().endsWith("lwt");
      localUri = null;
      if (!(bool))
        continue;
      str1 = "lewa/theme";
      localUri = MediaArgs.otherUri;
    }
  }

  public static FileTypeInfo getTypeInfo(String paramString)
  {
    return getTypeInfo(new FileInfo(paramString));
  }

  public static boolean isMedia(FileInfo paramFileInfo)
  {
    FileCategoryHelper.FileCategory localFileCategory = getTypeInfo(paramFileInfo).fc;
    return ((localFileCategory == FileCategoryHelper.FileCategory.Music) || (localFileCategory == FileCategoryHelper.FileCategory.Picture) || (localFileCategory == FileCategoryHelper.FileCategory.Video));
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.support.images.FileTypeInfo
 * JD-Core Version:    0.5.2
 */